package com.glory.cqaospda.model

import com.glory.cqaospda.bean.HeaderBean
import com.google.gson.Gson
import com.google.gson.JsonObject
import com.pda.platform.ui.ui_pdaplatform.utils_public.FreeApi_LogUtils
import org.apache.commons.lang3.StringEscapeUtils


open class BaseRepository {
    fun getInJsonData(map: JsonObject, messageName: String): String {
        val format: NetRequestBean<*> = NetRequestBean<Any>()
        format.body =map
        format.header = HeaderBean(messageName)
        val request = BaseRequest()
        request.request = format
        val map = hashMapOf<String,String>()
        map.put("",StringEscapeUtils.unescapeJson(Gson().toJson(request)))
//        Log.e("请求JSON", "getInJsonData: " + StringEscapeUtils.unescapeJson(Gson().toJson(request)))
        FreeApi_LogUtils.saveErrorMessages(StringEscapeUtils.unescapeJson(Gson().toJson(request)),"请求json")
        return StringEscapeUtils.unescapeJson(Gson().toJson(request))
    }

}